package com.zjkj.mp.service.message.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zjkj.mp.dao.message.SendInfoDao;
import com.zjkj.mp.service.message.SendInfoService;
import com.zjkj.mp.utils.PaginatedResult;
import com.zjkj.mp.vo.message.Message;

@Service
@Transactional(rollbackFor=Exception.class)
public class SendInfoServiceImpl implements SendInfoService {

	@Resource(name="sendInfoDaoImpl")
	SendInfoDao sendInfoDao;

	public List<Message> getMessageList(int tdId) {
		List<Message> list = null;
		if(tdId==0||"".equals(tdId)){
			list = sendInfoDao.getMessageList();
		} else {
			list = sendInfoDao.getMessageList(tdId);
		}
		return list;
	}

	public int delMessage(String fsId) {
		//删除明细
		sendInfoDao.delMessageMx(fsId);
		//删除条目
		return sendInfoDao.delMessage(fsId);
	}

	public PaginatedResult getMessagePageList(int nowPage, int maxRow,
			Map<String, Object> map) {
		return sendInfoDao.getMessagePageList(nowPage, maxRow, map);
	}

	@Override
	public PaginatedResult getMessageMxPageList(int nowPage, int maxRow,
			Map<String, Object> map) {
		return sendInfoDao.getMessageMxPageList(nowPage, maxRow, map);
	}

}
